workspace(name = "drake_ros")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_google_googletest",
    sha256 = "fbc8efdca4238e7dbe0642e29911a77be393f191a2444fa10372ee99bb665125",  # noqa
    strip_prefix = "googletest-1.12.0",  # noqa
    urls = [
        "https://github.com/google/googletest/archive/refs/tags/v1.12.0.zip",  # noqa
    ],
)

# Use the ROS 2 bazel rules
local_repository(
    name = "bazel_ros2_rules",
    path = "../bazel_ros2_rules",
)

load("@bazel_ros2_rules//deps:defs.bzl", "add_bazel_ros2_rules_dependencies")

add_bazel_ros2_rules_dependencies()

load("@bazel_ros2_rules//ros2:defs.bzl", "ros2_archive")
load("//:required_packages.bzl", "DRAKE_ROS_REQUIRED_PACKAGES")
load("//:required_packages.bzl", "DRAKE_ROS_TEST_DEPENDENCIES")

# Use ROS 2
ros2_archive(
    name = "ros2",
    include_packages = DRAKE_ROS_REQUIRED_PACKAGES + DRAKE_ROS_TEST_DEPENDENCIES,  # noqa
    sha256_url = "https://repo.ros2.org/ci_archives/nightly-cyclonedds/ros2-humble-linux-jammy-amd64-ci-CHECKSUM",  # noqa
    strip_prefix = "ros2-linux",
    url = "http://repo.ros2.org/ci_archives/nightly-cyclonedds/ros2-humble-linux-jammy-amd64-ci.tar.bz2",  # noqa
)

# Depend on Drake
load("//:drake.bzl", "DRAKE_SUGGESTED_VERSION")

http_archive(
    name = "drake",
    sha256 = DRAKE_SUGGESTED_VERSION.sha256,
    strip_prefix = DRAKE_SUGGESTED_VERSION.strip_prefix,
    urls = [
        DRAKE_SUGGESTED_VERSION.url,
    ],
)

load("@drake//tools/workspace:default.bzl", "add_default_workspace")

add_default_workspace()
